/**
 * @author bipul_sinha
 * @version 1.0
 * @created 21st November, 2010.
 *
 * BaseController
 *
 * Copyright CES @ 2010
 * All Rights Reserved.
 * CONFIDENTIAL AND TRADE SECRET
 */
package com.ces.knacky.framework.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.ces.knacky.framework.services.CommonService;

/**
 * It is the base controller class for the controller layers which requires to connect to services
 * available to perform operations. All controllers which needs to perform some database operation
 * must extend this class.
 * 
 * @author bipul_sinha
 * @see CommonService
 * @see IController
 */
@Controller
public abstract class BaseController implements IController {
	
	/**
	 * Provides services to be used by controllers. It provides services for CRUD and other 
	 * database operations.
	 */
	@Autowired
	protected CommonService commonService;

	/**
	 * This method is used to return the service configured via auto wiring.
	 * 
	 * @return 	service
	 * 			Represents commonService. Provides methods to perform database operations.
	 */
	public CommonService getCommonService() {
		return commonService;
	}

	/**
	 * Used to set the service object configured through wiring.
	 *  
	 * @param 	commonService
	 * 			Represents service to be used to perform application specific operations.
	 */
	public void setCommonService(CommonService commonService) {
		this.commonService = commonService;
	}
	
}
